package com.yeswater.multithread.chapter1.test1_12.test3;

import org.junit.Test;

/**
 * author : yeswater
 * date : 2023/10/19
 */

public class RunTest {

    @Test
    public void test1() throws InterruptedException {
        final MyObject obj = new MyObject();

        Thread t1 = new Thread(() -> {
            obj.setValue("a", "aa");
        });
        t1.setName("a");
        t1.start();

        Thread.sleep(500);

        Thread t2 = new Thread(obj::printUsernamePassword);
        t2.start();
    }

}
